Repository navigation
fix(service-analytics): list_datasets asks nothing when a word that falls back stands beside a grouping word - #36509
Conversation
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3d86e2cc40adcb213686e43416cb864ca062f938 && git checkout 3d86e2cc40adcb213686e43416cb864ca062f938
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0b2118f49c0f5b0a4b267b327bc8cfd257f182a8 bf7199432678a81f7878fe8f969a54bb8a66e802 && git checkout -B drift-repro 0b2118f49c0f5b0a4b267b327bc8cfd257f182a8 && git merge --no-ff bf7199432678a81f7878fe8f969a54bb8a66e802
node scripts/docs-audit/affected-docs.mjs --json 0b2118f49c0f5b0a4b267b327bc8cfd257f182a8
|
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 6c5c5e2 · 2026-11-22T16:07Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Read for this record: card #34996 (body and all 17 comments), PR #36509 (body, file list, net diff of 7 files against merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) — The executor, its jsdoc and the tool description treat every unknown word as the word for the thing measured; the skill does not, and for a question with no such word rule 5 still governs. A call whose words are a grouping that hits and an unknown word that is not a number word (a filter value or a second grouping no dataset lists: N1 (nit) — Eval assertions 21 to 23 forbid strings a correct reply may use in negation. Case 23 forbids N2 (nit) — Case 22 expects a sum "of the balance field grouped by the aging bucket field" on Verdict basis: the reading the change rests on is the record's (Q1), the ruled ask-back is untouched (Q2), the implementing code agrees with its contract in the case the PR targets, and no finding blocks. S1 is open on this head and earns a delta review of its fix. The pending Test Core shards and the eval seat's round are named above and are not covered by this record. Implemented-by: VERDICT: PASS |
…s a closing condition the client judges The executor cannot tell a word for a thing measured from a filter value, so a grouping beside an unknown word gets the fallback and then one conditional sentence: ask which number is meant only when the question has no word for a thing measured. The description states the same condition in the client's terms, and the jsdoc no longer says the fallback computes a number the user named. Skill row five names filter words; eval case 24 covers the call with no word for a thing measured; cases 21 to 23 forbid the question put to the user and the cut-down term as sent, not words a correct reply uses in negation. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head 4342cf0 · 2026-11-22T18:08Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Delta round on the record of comment 7081905010 (head ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. S1: closed — the three served texts and the jsdoc now agree in the case the finding named. For N1: closed — cases 21 and 22 forbid the question as put to the user ("Which number do you", "Which number would you" and their lower-case forms), not the bare phrase, and case 23 forbids the cut-down word as a term sent, not the quoted word. Under the grader's literal-substring rule a correct reply that uses the old strings in negation, or the skill's own contrast form, now passes. N2: closed — the dev's ground holds in the tree:
N3 (nit) — Case 23's forbidden spellings catch the cut-down word only at the start or the end of the terms array. The lifting the card's own eval reading reports (7041940806), N4 (nit) — Case 24's only N5 (nit) — Row five's "or filter words" also covers a call with no grouping at all, only an unknown filter word ( Verdict basis: S1 is closed in the note, the description, the jsdoc, the skill row and an eval case, with the pins green on the head; the reading of Q1 is kept and Q2 is untouched; the implementing code agrees with its contract in every branch read; nits only. The eval seat's round on the new conditional sentence and the ADR-0149 amendment note are named above and are not covered by this record. Implemented-by: VERDICT: PASS |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Regen-provenance: 7083451259 · The hop is a merge of main into the branch; every path it moves is main's carry-over, and none of the PR's own paths changed. The PASS at 4342cf0 carries to this head. |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY 维护者速读(席位记录 · head
|
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract-review-claim: session_01ADHkmT4eA4YqtxfiPyLPih · head bf71994 · 2026-11-22T18:44Z |
|
l2-review#4 · os-steve · session_01ADHkmT4eA4YqtxfiPyLPih Contract reviewServed-tier: Same-head record after a merge-of-main hop, on the record of comment 7083451259 (head ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. This is a merge-only hop: the PR-side patch did not change, so nothing new is judged in full.
S1, N1, N2: closed, as before. N3: accepted deviation, as before. N4: accepted deviation, as before. N5: accepted deviation, as before. Verdict basis: the hop is main's carry-over alone, the PR's patch is content-identical at both heads, no cited file moved in a way that reaches a judgment, and every check-run on this head is success or an expected skip. The PASS of 7083451259 holds at Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY Hand-off for approval: L1 ACCEPT at head |
Requested by Steve · project thread
Part of #34996. The card stays open: the 5-rep round that keeps or drops this change set is the eval seat's, and the ask-back over a single measure candidate is ruled behaviour this PR leaves as it is (see Acceptance notes).
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
One over-asking path, measured and fixed at its root, plus one term-lifting line. A question that names its number ("How many sales orders are in each status?") was asked back "which number do you mean?" whenever its grouping word equalled, or was near, a dataset dimension and no dataset measure answered to the number word. One object answers that question through the labelled fallback; the served text said to fall back and to ask in the same breath, and a careful client asked.
The served sentences, and why each reads as "ask" when one object matches
mainlist_datasetsanswer,nextStep.note(dataset-next-step.ts, thegroupingTailcopy, four locales)list_datasetstool description (dataset-tools.ts)skills/objectstack-ask/SKILL.md, served again byGET /mcp/skill)The fix
composeDatasetNextStepwrites the "which number" sentence only when every word sent is a grouping (it equals a dimension, or has only dimensions among its candidates). With an unknown word beside it (no measure, no dimension, no candidate) the note carries that word's labelled fallback and no question. Two branches change: theno_measurenote, and thecandidates_onlynote whose reported words are all possible groupings.decision,terms,matchesandcandidatesare untouched. Round 2 (head4342cf009, after L2 record 7081905010 S1) adds one copy key,noNumberTail, in four locales: beside such a fallback the note ends with "Only when the question has no word for a thing measured, ask the user which number they mean instead." The executor sees words, not which one names the number, so the client judges; the outright question stays for a call whose every word is a grouping, and is never written beside a fallback sentence.dataset-next-step.tsjsdoc states the executor's presumption and where it is wrong.packages/mcp/src/ask-skill.generated.tsis regenerated byscripts/gen-mcp-ask-skill.mjs, never hand-edited.skills/objectstack-ask/evals/metric-selection-fallback.json: the fallback beside a grouping candidate (quoting the note as the executor now writes it), the fallback beside a dimension match, the whole counting phrase as the first call, and (case 24, round 2) a grouping plus a filter word with no word for a thing measured, where the reply is the which-number question alone. Round 2 rewords the forbidden tokens of cases 21 to 23 to the question as put to the user and the cut-down word as a term sent; a grader proof ran 13 of 13 checks as wanted.What does not change, on purpose
initializerule (DATASET_SELECTION_RULE,mcp-server-runtime.ts) is not edited: read sentence by sentence, it asks only in those two ruled cases and says "No match and no candidates: fall back". It carries no dimension-alone sentence.Read first (by risk)
packages/services/service-analytics/src/dataset-next-step.ts: the two conditions incomposeDatasetNextStep(candidates_onlyandno_measure), and the header section "A grouping beside a word that falls back asks nothing".skills/objectstack-ask/SKILL.md: step 2 rows five and six, and the cut clause in the paragraph under the table.packages/services/service-analytics/src/dataset-tools.ts: one sentence ofLIST_DATASETS_DESCRIPTION.Skill size (governed catalog; growth is paid by deletion in the same file)
skills/objectstack-ask/SKILL.mdlinesskills/objectstack-ask/SKILL.mdtokens (the ratchet's count; ceiling 1877, not moved)SKILL.mdfiles, linesevals/metric-selection-fallback.json(eval fixture, measured, not ratcheted): lines, tokensAdded to the skill: the counting-head example (+32 bytes) and the two reworded rows (+75). Deleted: the clause "; when their word matched nothing and has no candidates, go to step 4 instead of asking about some other word's matches" (-119), whose content the fallback row now carries. Net -12 bytes at round 1 (7520 to 7508); round 2 adds " or filter words" to row five: 7518 bytes, 1875 tokens, headroom 2.
Tests
Measured: what
list_datasetsserves for the gallery's failing questions. The scenario cards pin their datasets, so the real matcher, candidate finder and note composer were run overdocs/qa/scenarios/order_to_cash.jsonandtravel_expense.json(a scratch script, one node process, localeen), at base59392ed1dand at head6c5c5e2ae. The terms are this author's lifting of each question by the skill's step 1, not a recording: the gallery recordings are not readable from this container.orders_by_status)candidates_only: offers Order status as a possible grouping, then "A grouping alone is no answer: ask the user which number they mean.", then the fallback for "sales orders"no_measure: "Answer with the object query tools ..." and "A grouping alone is no answer: ask the user which number they mean."receivables_aging)no_measure: fallback and the question, bothclaims_by_status, the eval reading)candidates_only: Claimed amount and Claim count offered, asked about (correct for that word)one_measure: Claim count, computed, status offered as a groupingbooked_by_category)candidates_only: one measure candidate (Booked amount), asked aboutThe three notes that changed, in full (base, then head)
Of 22 term sets tried over the two cards, these 3 changed and 19 are byte-identical at base and head.
Round 2, at head
4342cf009(under the verify lock unless said): service-analyticsdataset-tools.test.ts95 passed | 10 skipped; package suite 5730 passed | 345 skipped (224 files), typecheck exit 0; mcp typecheck exit 0; mcp suite 1466 passed with 1 failed on two runs, the failure beingmcp-file-tools.test.ts"a worker past its wall-clock ceiling is terminated" (a 200 ms load-sensitive worker-pool test this diff does not reach; 54 of 54 alone, green on CI). Ablations throughscripts/ablation-replace.mjs, restore proven by blob: the closing condition dropped fromno_measure(2 red) and fromcandidates_only(1 red); the outright question written beside a fallback again incandidates_only(1 red) andno_measure(2 red), the vitest red legs round 1 left NOT MEASURED. A fifth (condition written with no grouping beside the unknown word) was read by a single-process probe (red in 4 locales, restored green); its vitest leg is NOT MEASURED, the lock not obtained.gen-mcp-ask-skill.mjs --checkexit 0; skill-evals--dry-run31 cases.The round 1 readings below are kept as measured at
6c5c5e2ae.All at head
6c5c5e2ae, each under the shared verify lock, exit read from the lock's VERDICT line.pnpm --filter @objectstack/service-analytics test:Test Files 224 passed (224),Tests 5729 passed | 345 skipped (6074);pnpm --filter @objectstack/service-analytics typecheck: exit 0. VERDICT command-exit 0.pnpm --filter @objectstack/mcp test(after rebuilding@objectstack/service-analyticsand@objectstack/mcp, since the MCP pins read the description from the built package):Test Files 83 passed (83),Tests 1467 passed (1467);pnpm --filter @objectstack/mcp typecheck: exit 0. VERDICT command-exit 0. This run holdsskill-single-source-34686.test.ts(the generated mirror equals the skill) andinitialize-selection-rule-34686.test.ts(the sentence the two doors share is unchanged).packages/services/service-analytics/src/__tests__/dataset-tools.test.ts: the mixedno_measurenote falls back and asks nothing, in four locales, with the lone grouping word as the same-locale control; a grouping candidate beside an unknown word falls back and asks nothing, with a lone candidate and two groupings as controls that still ask; an unknown word beside a measure candidate keeps the question about that candidate.pnpm --filter @objectstack/scenarios skill-evals --dry-run --skills objectstack-ask: exit 0, "objectstack-ask: 30 case(s)", "23 behaviour case(s) × 2 arms + 7 trigger case(s)", "dry run: no login read, no model called, nothing written". By script: ids 1 to 23 distinct, each new case holds everymust_containtoken in its expected output and nomust_not_containtoken.Ablation: each changed branch, once (narrowed, declared)
The fix was committed first. Each mutation went through
scripts/ablation-replace.mjs(anchor hit once, blob changed, restore proven: blob equals HEADb241cbd65a5a,git diff HEADempty).candidates_onlybranch back toif (asked.length === 0): the note for a grouping candidate beside an unknown word asks "which number" again in all four locales; theno_measurecase stays fixed.no_measurebranch back to writing both sentences: the mixed note asks again in all four locales; thecandidates_onlycase stays fixed.Narrowing, declared. The red runs were read through a single-process probe of the composer (the pins' two fixtures and the same sentences, no test runner), not through vitest. The vitest red leg is NOT MEASURED: four attempts to take the verify lock for it each ended
VERDICT queue-timeout (exit 99)over about 45 minutes while another worktree's full dogfood battery held the lock (pid 17598, alive, held over 70 minutes at the last reading). The green leg of the pins is the package run above.Acceptance notes
--packages workspacebuilt from this branch (the note is composed in@objectstack/service-analytics, so npm 18.6.0 cannot show it), against the last kept round onmain. Cards:travel_expense(the loop's card;claims_by_statusis the counting-head item) andorder_to_cash(orders_by_statusandreceivables_agingare the fallback-beside-a-grouping items). Keep when asked-back on ordinary questions falls on those items and the dataset ask-back cases (the several-match and measure-candidate cases) hold at their last kept score; drop otherwise. No model round ran here: NOT MEASURED, reason: paid rounds and the gallery belong to the eval seat.mainstopped that before this PR.mainwrote both instructions into one note. This PR reads rule 4 as governing the unknown word and rule 5 as the rule for a question with no number word, on M2 ruled A ("answers everything it answers today, and the governed answers are marked"). A reviewer who reads rule 5 as governing the mixed case should stop this PR at review.main. The ceiling is not moved.4342cf009; its nits N3 to N5 are accepted (N5 folds into the ADR-0149 amendment carried by ADR revisions, week of 2026-11-21: rolling checklist of ADR text out of step with main (one governed PR) #36086, with the rule-4 reading and thenoNumberTailsentence).Verification
Two minutes:
pnpm --filter @objectstack/service-analytics exec vitest run --maxWorkers=2 src/__tests__/dataset-tools.test.tsprintsTest Files 1 passed (1)andTests 95 passed | 10 skipped (105). Thennode scripts/gen-mcp-ask-skill.mjs --checkprints "is current with skills/objectstack-ask/SKILL.md", andnode scripts/check-skills-token-ratchet.mjsprints "skills/objectstack-ask/SKILL.md is 1875 tokens (ceiling 1877; headroom 2)".Gates
node scripts/pm/dispatch-gates.mjs --commandsat6c5c5e2ae(7 paths vs merge base59392ed1d): 83 commands, run serially, each exit code recorded before any pipe.--ran: "83 derived famil(ies) accounted for — 81 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)", 0 unrun; the 81 exited 0.check:dual-build-cjs-loads(exit 3, needs a whole-workspace build) andcheck:type-check-debt(exit 3, its re-measure could not take the verify lock). CI carries both.node scripts/gen-mcp-ask-skill.mjs --checkexit 0 ("is current with skills/objectstack-ask/SKILL.md");node scripts/check-skills-token-ratchet.mjsexit 0 ("skills/objectstack-ask/SKILL.md is 1872 tokens (ceiling 1877; headroom 5)").node scripts/pm/overlap-check.mjs: "VERDICT clean exit 0" (origin/main and the one open PR sharing the skill file merge cleanly).node scripts/pm/check-governed-merges.mjs --branch HEAD: exit 3, GOVERNED, Tier H (skills/**, 2 paths). This PR stays draft; no reviewer is requested here.node scripts/pm/dispatch-gates.mjs --tier: mandatory contract-review tier forskills/**; this change was authored at that tier. A contract-review-tier review is owed before the governed landing.test:reponot run locally (CI owns it; the diff touches no test of that project).🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY